<?php

require_once 'web-bloks/ObjFactory/ObjFactory.php';
require_once 'web-bloks/BaseClass/BaseClass.php';
require_once 'web-bloks/Singleton/Singleton.php';

class TestClass extends WB_ObjFactory
{
	protected function __construct()
	{
		parent::__construct();
	}
	
	public static function get( $class = __CLASS__ )
	{
		return parent::get( $class );
	}	
	
	public static function factory( $class )	
	{
		return 'bidon';
	}
}

class BidonClass
{
	
}

// for testing singleton functionality

class BidonClassNotSingleton
	extends WB_BaseClass
{
	public function getClassPath()
	{
		return dirname( __FILE__ );
	}

	/**
	 * getClassVersion
	 * 
	 * @return string version
	 */
	public function getClassVersion()
	{
		return '$Id: UnitTestClass.php 88 2008-03-06 03:31:51Z jldupont $';
	}
	
}

class BidonClassSingleton
	extends WB_BaseClass
	implements WB_Singleton_IF
{
	
	static $instance = null;
	
	public function getClassPath()
	{
		return dirname( __FILE__ );
	}

	/**
	 * getClassVersion
	 * 
	 * @return string version
	 */
	public function getClassVersion()
	{
		return '$Id: UnitTestClass.php 88 2008-03-06 03:31:51Z jldupont $';
	}
	
	public static function getSingleton( $params = null )
	{
		//WB_BaseClass
		return self::_handleSingleton( self::$instance, 'BidonClassSingleton', $params );
	}
}
